package com.crawljax.core;

import com.crawljax.browser.ElementType;
import com.crawljax.core.state.Identification.How;

/**
 * added by GuZhiwei
 */
public class Authentication {
	private String url;
	private How how;
	private String element;
	private ElementType elementType;
	private String value;
	
	public Authentication() {
		super();
	}

	/**
	 * make a authentication to login the tested web
	 * @param how
	 * @param element the unique id of the element
	 * @param elementType
	 * @param value if the element is a text area, you can put this value to it, 
	 * 				else if the element is a button, you can make the value as 
	 * 				"click" to click it
	 */
	public Authentication(String url, How how, String element, ElementType elementType, String value) {
		super();
		this.url = url;
		this.how = how;
		this.element = element;
		this.elementType = elementType;
		this.value = value;
	}
	
	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public How getHow() {
		return how;
	}
	public void setHow(How how) {
		this.how = how;
	}
	public String getElement() {
		return element;
	}
	public void setElement(String element) {
		this.element = element;
	}
	public ElementType getElementType() {
		return elementType;
	}
	public void setElementType(ElementType elementType) {
		this.elementType = elementType;
	}
	public String getValue() {
		return value;
	}
	public void setValue(String value) {
		this.value = value;
	}

	@Override
	public String toString() {
		return "Authentication [url=" + url + ", how=" + how + ", element=" + element + ", elementType=" + elementType
				+ ", value=" + value + "]";
	}
	
}
